using System;
using System.Linq;

namespace OrbitOne.Elmah.Data
{
    ///<summary>
    /// Represents the IElmahDataProvider
    ///</summary>
    public interface IElmahDataProvider : IDisposable
    {
        /// <summary>
        /// Gets the <code>IElmahContext</code>
        /// </summary>
        IElmahContext Context { get; }

        /// <summary>
        /// Get All the entities of type T
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns>An <code>IQueryable:T</code></returns>
        IQueryable<T> GetAll<T>();
        /// <summary>
        /// Get the entity of type T by Id
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="S"></typeparam>
        /// <param name="id"></param>
        /// <returns></returns>
        T GetById<T, S>(S id);
    }
}